<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>fill (Table::RTable)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File rtable.rb, line 113</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fill</span> <span class="ruby-identifier">str</span>,<span class="ruby-identifier">row</span>,<span class="ruby-identifier">foo</span>=<span class="ruby-keyword kw">nil</span>
    <span class="ruby-identifier">str</span> = <span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_s</span>
    <span class="ruby-identifier">col</span> = <span class="ruby-ivar">@rows</span>[<span class="ruby-identifier">row</span>][<span class="ruby-identifier">:cols</span>].<span class="ruby-identifier">length</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">foo</span>
    <span class="ruby-identifier">col</span> = <span class="ruby-identifier">foo</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">foo</span>
    <span class="ruby-identifier">ocol</span> = <span class="ruby-identifier">col</span>
    <span class="ruby-ivar">@rows</span>[<span class="ruby-identifier">row</span>][<span class="ruby-identifier">:cols</span>][<span class="ruby-identifier">col</span>]=<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-ivar">@defualt_align_method</span>,<span class="ruby-identifier">str</span>,<span class="ruby-ivar">@cell_len</span>,<span class="ruby-ivar">@def_space</span>)
    <span class="ruby-identifier">done</span> = <span class="ruby-keyword kw">false</span>
    <span class="ruby-identifier">init_y</span> = <span class="ruby-identifier">col</span>
    <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-ivar">@cell_len</span>
      <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@also</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-node">&quot;#{row}:#{init_y}&quot;</span>)
        <span class="ruby-ivar">@also</span>[<span class="ruby-node">&quot;#{row}:#{col}&quot;</span>]=[]
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-identifier">str</span> = <span class="ruby-identifier">str</span>[<span class="ruby-ivar">@rows</span>[<span class="ruby-identifier">row</span>][<span class="ruby-identifier">:cols</span>][<span class="ruby-identifier">col</span>].<span class="ruby-identifier">length</span><span class="ruby-operator">..</span><span class="ruby-identifier">str</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>]
      <span class="ruby-identifier">col</span> = <span class="ruby-identifier">col</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
      <span class="ruby-ivar">@rows</span>[<span class="ruby-identifier">row</span>][<span class="ruby-identifier">:cols</span>][<span class="ruby-identifier">col</span>] = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-ivar">@defualt_align_method</span>,<span class="ruby-identifier">str</span>,<span class="ruby-ivar">@cell_len</span>,<span class="ruby-ivar">@def_space</span>)
      <span class="ruby-ivar">@alias_format</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-node">&quot;#{row}:#{col}&quot;</span>,<span class="ruby-identifier">row</span>,<span class="ruby-identifier">init_y</span>]
      <span class="ruby-ivar">@also</span>[<span class="ruby-node">&quot;#{row}:#{init_y}&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">col</span>
    <span class="ruby-keyword kw">end</span>
    [<span class="ruby-identifier">ocol</span>,<span class="ruby-identifier">row_col_length</span>(<span class="ruby-identifier">row</span>)]
  <span class="ruby-keyword kw">end</span></pre>
</body>
</html>